home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / Traps.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  3.3 KB  |  140 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Traps.a
  3. ;
  4. ;    Contains:    A-Trap constants.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1985-1997 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__TRAPS__') = 'UNDEFINED' THEN
  19. __TRAPS__ SET 1
  20.  
  21.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  22.     include 'ConditionalMacros.a'
  23.     ENDIF
  24.  
  25.  
  26. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  27. ;
  28. ;         Trap OPWORDS are now defined in each manager    
  29. ;         
  30. ;             Example:
  31. ;            
  32. ;                _GetResource    OPWORD    $A9A0
  33. ;                
  34. ;             is now in the file 'Resources.a'
  35. ;        
  36. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
  37.  
  38.  
  39.  
  40. ;    The floating point traps are needed because SANEMacs.a relies on Traps.a
  41. ;    defining them.  We won't be fixing SANEMacs.a, so putting the traps here
  42. ;     allows developers to use Universal AIncludes more easily.
  43. ;
  44.     IF TARGET_CPU_68K THEN
  45.         UnimplementedTrap:    EQU        $A89F
  46.         _Unimplemented:        OPWORD    $A89F
  47.         _FP68K:                OPWORD    $A9EB
  48.         _Elems68K:            OPWORD    $A9EC
  49.         _DecStr68K:            OPWORD    $A9EE
  50.     ENDIF
  51.  
  52.  
  53.  
  54.     IF TARGET_CPU_68K THEN
  55. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  56. ;
  57. ;    MoveTrapWord
  58. ;         
  59. ;     This macro allows OPWORDs to be used as parameters to Get/SetTrapAddress.
  60. ;    For examples:
  61. ;
  62. ;            MoveTrapWord    _GetResource,D0        ; ->    Move.w    #$A9A0,D0
  63. ;            _GetToolboxTrapAddress
  64. ;
  65. ;            MoveTrapWord    $A060,D0            ; ->    Move.w    #$A060,D0
  66. ;            _GetOSTrapAddress
  67. ;        
  68. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
  69.     Macro
  70.     MoveTrapWord &trap,&dest=D0
  71.         gbla &trapNum
  72.  
  73.         If &trap = '' then
  74.             AError 'must specify trap number or name'
  75.             Exitm
  76.         Elseif &type(&upcase(&trap)) = 'OPWORD' then
  77.             If &findsym(&sysglobal, &upcase(&trap)) then
  78.                 &trapNum: seta &sysvalue
  79.             Elseif &findsym(&syslocal, &upcase(&trap)) then
  80.                 &trapNum: seta &sysvalue
  81.             Else
  82.                 aerror 'internal error in MoveTrapWord (an OPWORD, but not in any symbol table??)'
  83.                 ExitM
  84.             endif
  85.         Else
  86.             &trapNum: seta &eval(&trap)
  87.         Endif
  88.         If ((&trapNum < 0) or (&trapNum > $3FFC)) and ((&trapNum and $F000) ≠ $A000) then
  89.             AError 'not a valid trap number ($A000 - $AFFF)'
  90.             ExitM
  91.         Endif
  92.         move.w    #&trapNum,&dest
  93.     EndM
  94.     ENDIF    ; TARGET_CPU_68K
  95.  
  96.  
  97.  
  98.  
  99.     IF OLDROUTINENAMES THEN
  100. ;        The following equates are for compatibility with old option bits
  101. ;        
  102. ;            Example:
  103. ;                    _NewPtr, sys        ; old way
  104. ;        
  105. ;        The new way is to use the C name:
  106. ;        
  107. ;            Examle:
  108. ;                    _NewPtrSys            ; new way
  109. ;
  110. ;
  111.  
  112. ;
  113. ; for Device and File Manager routines 
  114. immed                            EQU        $200                ; execute immediately, bypass I/O queue
  115. async                            EQU        $400                ; asynchronous, don't wait for completion
  116. ;
  117. ; for Memory Manager routines 
  118. clear                            EQU        $200
  119. sys                                EQU        $400
  120. ;
  121. ; for string routines 
  122. marks                            EQU        $200                ; set to ignore/strip diacriticals
  123. Case                            EQU        $400                ; set for case sensitivity        
  124. autoPop                            EQU        $400                ; set to pop an extra return address
  125. ;
  126. ; for Get/Set & NGet/NSet TrapAddress 
  127. newTool                            EQU        $600                ; Toolbox trap, under new ordering
  128. newOS                            EQU        $200                ; OS trap, under new ordering
  129. ;
  130. ; for HFS routines 
  131. newHFS                            EQU        $200
  132.  
  133.     ENDIF    ; OLDROUTINENAMES
  134.  
  135.     ENDIF ; __TRAPS__ 
  136.  
  137.